package main

import (
	"fmt"
	"game/game-design/export"
	"game/game-design/gen"
	"game/game-design/merge"
	"os"
)

func main() {
	//测试用导出配置
	// args := []string{
	// 	"export",
	// 	"-reader excel",
	// 	"-mode full D:\\Git\\sanguo-svn-design\\excelmd5",
	// 	"-define name:1 type:2 tag:4 comment:3 bothTag:all serverTag:server clientTag:client ignoreTag:-",
	// 	"-sourcehome D:\\Git\\sanguo-svn-design\\tables\\",
	// 	"-language LanguageAuto.xlsx LanguageAuto",
	// 	"-exportfor server tjson D:\\Git\\sanguo-svn-design\\exports\\server\\ useFileName",
	// 	"-exportfor client tjson D:\\Git\\sanguo-svn-design\\exports\\client\\ useClassName",
	// 	"-exportfor client tjson D:\\Git\\sanguo-svn-design\\exports\\client4code\\ useFileName",
	// 	"-dealfiles ", //处理哪些文件，空则导出所有文件
	// }
	// 测试用生成Java代码的参数
	// args := []string{
	// 	"gen",
	// 	"-define name:1 type:2 tag:4 comment:3 bothTag:all serverTag:server clientTag:client ignoreTag:-",
	// 	"-template D:\\Git\\sanguo-server\\java-template.txt",
	// 	"-arg abstract_output_path D:\\Git\\sanguo-server\\sanguo-design\\src\\main\\java\\com\\linlong\\sanguo\\design\\tables\\autogen\\",
	// 	"-arg subclass_output_path D:\\Git\\sanguo-server\\sanguo-design\\src\\main\\java\\com\\linlong\\sanguo\\design\\tables\\",
	// 	"-sourcehome D:\\Git\\sanguo-svn-design\\exports\\server\\",
	// 	"-reader tjson",
	// }
	// 测试用生成ts代码的参数
	// args := []string{
	// 	"gen",
	// 	"-define name:1 type:2 tag:4 comment:3 bothTag:all serverTag:server clientTag:client ignoreTag:-",
	// 	"-template D:\\Git\\sanguo-svn-design\\ts-template.txt",
	// 	"-arg output_path D:\\cocos\\test-design\\assets\\scripts\\design\\tableSingle\\",
	// 	"-sourcehome D:\\Git\\sanguo-svn-design\\exports\\client4code\\",
	// 	"-reader tjson",
	// }
	//合并文件
	// args := []string{
	// 	"merge",
	// 	"-sourcehome D:\\Git\\sanguo-svn-design\\exports\\client\\",
	// 	"-outputfile D:\\Git\\sanguo-svn-design\\exports\\cfg.json",
	// }
	//生成目录
	// args := []string{
	// 	"catalog",
	// 	"-define name:1 type:2 tag:4 comment:3 bothTag:all serverTag:server clientTag:client ignoreTag:-",
	// 	"-template D:\\Git\\sanguo-svn-design\\ts-template-catalog.txt",
	// 	"-sourcehome D:\\Git\\sanguo-svn-design\\exports\\client\\",
	// 	"-arg output_path D:\\cocos\\test-design\\assets\\scripts\\design\\",
	// 	"-reader tjson",
	// }

	//打包正式环境参数
	args := os.Args[1:]

	for _, v := range args {
		fmt.Println(v)
	}

	if args[0] == "export" {
		export.Export(args)
	} else if args[0] == "gen" {
		gen.Generate(args)
	} else if args[0] == "merge" {
		merge.Merge(args)
	} else if args[0] == "catalog" {
		merge.CatalogFun(args)
	}
}
